package DBLayer;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import ModelLayer.Treatment;
import ModelLayer.TreatmentCategory;

public class DBTreatmentTest {
	private IFDBTreatment dbTreat;
	
	@Before
	public void setUp() throws Exception {
		dbTreat = new DBTreatment();
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetTreatmentsByCatId() 
	{
		try
		{
			TreatmentCategory treatCat = new TreatmentCategory();
			treatCat.setId(1);
			
			ArrayList<Treatment> treatments = dbTreat.getTreatmentsByCatId(treatCat.getId());
			
			System.out.println("Treatments by category:");
			
			for(Treatment treat : treatments)
			{
				System.out.println(treat.getTitle() + " " + "Estimated time: " + treat.getEstimatedTime());
			}
		}
		catch(Exception err)
		{
			fail("Not yet implemented");
		}
	}

}
